From 4b96dd509810d4877a7d8fb18dd20b99bb271f2c Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 10 Feb 2004 13:51:24 +0000 Subject: [PATCH] Add -N option to suppress smart icons. --- gpsbabel/defs.h | 1 + gpsbabel/main.c | 4 ++++ gpsbabel/mingw/Makefile | 2 +- gpsbabel/mingw/mkwintesto.c | 14 +++++++++++++- gpsbabel/util.c | 3 +++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index 5bd68dae4..807b2362c 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -67,6 +67,7 @@ typedef struct { int debug_level; gpsdata_type objective; int verbose_status; /* set by GUI wrappers for status */ + int no_smart_icons; } global_options; extern global_options global_opts; diff --git a/gpsbabel/main.c b/gpsbabel/main.c index 6c63cccc6..5d0490a3d 100644 --- a/gpsbabel/main.c +++ b/gpsbabel/main.c @@ -51,6 +51,7 @@ usage(const char *pname) " -r Process route information\n" " -t Process track information\n" " -w Process waypoint information [default]\n" +" -N No smart icons on output\n" " -x filtername Invoke filter\n" " -D level Set debug level [%d]\n" "\n" @@ -167,6 +168,9 @@ main(int argc, char *argv[]) case 'r': global_opts.objective = rtedata; break; + case 'N': + global_opts.no_smart_icons = 1; + break; case 'x': optarg = argv[argn][2] ? argv[argn]+2 : argv[++argn]; diff --git a/gpsbabel/mingw/Makefile b/gpsbabel/mingw/Makefile index c3ad1a0f6..03967bc59 100644 --- a/gpsbabel/mingw/Makefile +++ b/gpsbabel/mingw/Makefile @@ -14,7 +14,7 @@ gpsbabel.exe: $(OBJS) cp gpsbabel.exe /tmp mkwintesto: mkwintesto.c - /usr/bin/cc mkwintesto.c ../util.c -o mkwintesto + /usr/bin/cc mkwintesto.c -o mkwintesto wintesto.cmd: mkwintesto ./mkwintesto ../testo diff --git a/gpsbabel/mingw/mkwintesto.c b/gpsbabel/mingw/mkwintesto.c index be4997388..24bad24e2 100644 --- a/gpsbabel/mingw/mkwintesto.c +++ b/gpsbabel/mingw/mkwintesto.c @@ -29,6 +29,7 @@ #include #include +#include #define LINELENGTH 200 #define MYNAME "MkWinTesto" @@ -80,9 +81,20 @@ int f_outputLine ( return 0; } +/* ------------------------------------------------------------------------------------ */ +void +fatal(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + exit(1); +} + /* ------------------------------------------------------------------------------------ */ int main( - int argc, +int argc, char *argv[]) { char acLineIn[LINELENGTH]; diff --git a/gpsbabel/util.c b/gpsbabel/util.c index f4628e316..354ace1c3 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -453,6 +453,9 @@ get_tz_offset(void) const char * get_cache_icon(const waypoint *waypointp) { + if (global_opts.no_smart_icons) + return NULL; + /* * For icons, type overwrites container. So a multi-micro will * get the icons for "multi". -- 2.30.2